/*function getData(){
    var rows = [];
    for(var i=1; i<=800; i++){
        var amount = Math.floor(Math.random()*1000);
        var price = Math.floor(Math.random()*1000);
        rows.push({
            inv: 'Inv No '+i,
            date: $.fn.datebox.defaults.formatter(new Date()),
            name: 'Name '+i,
            amount: amount,
            price: price,
            cost: amount*price,
            note: 'Note '+i
        });
    }
    return rows;
}*/

function add_user(){
    window.parent.addTab("角色新增", "../role/role_add");
}

function searchSubmit(){
    $("#searchForm").submit();
}

function edit_user(){
    var obj=$("#role_table").datagrid('getSelected');
    if(obj==null){
        alert("请选择员工！");
        return;
    }
    var role_id=obj.role_id;
    window.parent.addTab("角色编辑","../role/role_edit?role_id="+role_id);
}